#include <vector>
#include <algorithm>
using namespace std;

//TODO
double median(std::vector<double> vec){
    std::sort(vec.begin(), vec.end());
    auto size = vec.size();
    if (size%2==0)return (vec[size/2-1]+vec[size/2])/2.0;
    else return vec[size/2];
}
double average(const std::vector<double> &vec){
    double sum = 0;
    for(auto n:vec) sum += n;
    return sum/vec.size();
}